This extension changes the clipboard contents. The changes affect the lower/uppercase and the diacritical characters. An example is best than a long speech, so you can see below the same sentence (in French), with the five possibilities in this extension. The extension uses the current script: it should work well in any country.
ModifyText Upper enforce
NOΦL ╦ L'╬UVRE : L'âTâ MµME !
ModifyText Lower enforce
noæl ê l'╧uvre : l'ÄtÄ mÉme !
ModifyText Sentence enforce
Noæl ê l'╧uvre : l'ÄtÄ mÉme !
ModifyText Strip enforce
noel a l'╧uvre : l'ete meme !
ModifyText StripUpper enforce
NOEL A L'╬UVRE : L'ETE MEME !
Tip: when you use a macro that changes the clipboard inside an application that uses a private clipboard, you should tell the application to write the private clipboard's contents in the public clipboard before the macro reads it. And you should tell the application to read the public clipboard and fill its private clipboard after the macro has modified the public clipboard. To do that, you should add the "enforce" parameter to the first and to the last instruction that uses the clipboard in the macro. You can also use the Enforce extension described below.
Ñ CLIPBOARDMESSAGE
This extension is similar to the "Message" extension. It can be used instead of it (simply replace the old name with the new name, all yours old scripts work in the same way as before). The ClipboardMessage extension displays an alert box with a text string or the clipboard contents, or both (in the order you want). You can insert line-feeds before the first string or between the two strings if you wish. You also can suppress the extension name that KeyQuencer automatically adds.
Tip: if you use the clipboard, don't forget to read the previous tip.
Ñ ENFORCE
This extension makes the clipboard management easier. When you use a macro that uses the clipboard (by calling ChangeClip, Clipboard, ClipboardMessage, ModifyText) in an application that has a private clipboard, you should:
- tell the application to copy its private clipboard in the public one before the first read of the clipboard in your macro, and
- tell the application to copy the public clipboard in its private clipboard after the last modification of the clipboard in your macro.
All the commands that use the clipboard have an "enforce" parameter. This parameter tells the application to synchronize the private clipboard and the public clipboard. One usually adds this parameter to the first and the last command that use the clipboard in a macro.
If you often modify your macro, it is complicated to take care of this parameter and its position in the macro. You can use my Enforce command without any parameter as the first and the last command in your macro (if one of the last commands can abort the macro, then Enforce should be called before it to make sure it won't be skipped).
This method has a drawback (the same as with the enforce parameter in the commands): by forcing the writing and reading of the clipboard by the current application, it also tells the application to compress its data, hide its palette windows, etc. You can use the command "enforce first" as the first line of your macro, and "enforce last" as the last line of your macro, so that only one write and one read will be executed. However, if the last line of your macro is not executed, the application is stopped and you should switch to the Finder and back to the application to reactivate it. You can often use the "quiet" parameter to avoid stopping the macro before it's finished.
Ñ LOGFILE
The LogFile extension opens the file "filename" for writing (and creates the file if needed). It appends a new line to the file with the "text" parameter. If the date option is set, the date (in long format) is inserted before the text, followed by a tab character (so you can copy:paste the logfile contents in a spreadsheet or database program). If the "quiet" option is set, no error message is displayed if an error occurs during the writing.
This extension is useful when KeyQuencer macros are launched from an AppleScript script that periodically calls some KQ macros. It allows you to have a text file where all the macro executions are recorded.
You can contact me via e-mail for more information.